/*
 * MailMessageResource.h
 *
 *  Created on: 2013. 11. 15.
 *      Author: mega@gamevil.com
 */

#ifndef MAILMESSAGERESOURCE_H_
#define MAILMESSAGERESOURCE_H_

#include <map>
#include <Toolkit/Str.h>
#include <Database/Static.h>

namespace ProjectZ { namespace NResource {

class MailMessageResource
{
public:
	enum MailMessageType
	{
		__NONE__,

		EM_TRADE_ITEM_BUY	= 1,
		EM_TRADE_ITEM_CANCEL,
		EM_TRADE_ITEM_SOLDOUT,
		EM_FRIENDSHIP_BOX_REWARD,
		EM_DAILY_REWARD,
		EM_LAST_WEEK_RANKING_REWARD,
		EM_MONTH_CHARGING_REWARD,
		EM_FAIRY_PACKAGE,
		EM_BATTLEPET_PACKAGE,
		EM_PVP_WIN_REWARD,				// 10
		EM_ITEM_GACHYA_RESULT,
		EM_DUNGEON_REWARD_NORMAL_ITEM,
		EM_DUNGEON_REWARD_ZEN_ITEM,
		EM_FREE_CHARGE_REWARD,
		EM_GIFT_ZEN,
		EM_CONNECT_EVENT,
		EM_WORLDBOSS_REWARD,
		EM_DAILY_MISSION_REWARD,
	};

public:
	struct Flyweight
	{
		int _MESSAGE_TYPE;
		Toolkit::Str<128> _MESSAGE;
	};

public:
	MailMessageResource();
	virtual ~MailMessageResource();

	bool		LoadResource();
	Flyweight *	GetFly(MailMessageType eType);

	const char *	GetMessageTradeItemBuy();
	const char *	GetMessageTradeItemCancel();
	const char *	GetMessageTradeItemSoldout();
	const char *	GetMessageFriendshipReward();
	const char *	GetMessageDailyReward();
	const char *	GetMessageWeeklyRankingReward();
	const char *	GetMessageMonthChargingEventReward();
	const char *	GetMessageFairyPackage();
	const char *	GetMessageBattlepetPackage();
	const char *	GetMessagePVPWinReward();
	const char *	GetMessageItemGachya();
	const char *	GetMessageDungeonReward(int gachyaType);
	const char *	GetMessageFreeChargeReward();
	const char *	GetMessageGiftZen();
	const char *	GetMessageConnectEvent();
	const char *	GetMessageWorldBossReward();
	const char *	GetMessageDailyMissionReward();

private:
	void	Clear();

public:
	typedef std::map<int, Flyweight *> MAILMESSAGETREE;

private:
	std::string 	emptyMessage;

	MAILMESSAGETREE	clsFlyTree;
};

} /*NResource*/ } /*ProjectZ*/

#endif /* MAILMESSAGERESOURCE_H_ */
